import maya.cmds as mc

class LZ_controllar_command():
    def __init__(self):
        pass
        
    def creatControls_command(self,type = 1 ,curName='',add=True):
        if type==1:
            pointInfo=[(-2,0, 0),(-2, 0, -1),( 0, 0 ,-1),( 0, 0, -2),( 2, 0 ,0 ),( 0, 0, 2),( 0 ,0 ,1),( -2, 0, 1),( -2, 0, 0)]
            pioint_K = [0,1,2,3,4,5,6,7,8]
            degreee = 1
        if type ==2 :   ###  facial ctrl 
            pointInfo = [(-0.5, 0.5, -0.5), (-0.5, -0.5, -0.5),( -0.5, -0.5, 0.5),( -0.5, 0.5, 0.5),(-0.5, 0.5, -0.5),( 0.5, 0.5 ,-0.5),( 0.5, 0.5, 0.5 ),( -0.5 ,0.5 ,0.5),( -0.5 ,-0.5, 0.5),( 0.5, -0.5, 0.5 ),( 0.5 ,0.5 ,0.5 ),( 0.5, 0.5, -0.5),( 0.5, -0.5, -0.5),( 0.5, -0.5, 0.5),( 0.5, -0.5,-0.5),(-0.5, -0.5, -0.5)]
            pioint_K = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]
            degreee = 1
        
        if type == 3:  ##  eye ctrl
            pointInfo = [(-0.273501,0.398437,0),( 0.279265, 0.399227, 0),(0.284735, 0.4 ,0 ),( 0.287565, 0.405343 ,0 ),(0.334556 ,0.514181, 0 ),(0.553402, 0.840365 ,0 ),(1.2 ,1.108194, 0 ),(1.983612, 0.783612, 0 ),( 2.308194 ,0 ,0 ),(1.983612, -0.783612, 0),( 1.2, -1.108194, 0 ),(0.553402, -0.840365, 0 ),(0.334556 ,-0.514181, 0 ),( 0.28798, -0.40954 ,0 ),( 0.284735, -0.4 ,0 ),(0.27551, -0.400633 ,0 ),( -0.279436, -0.400321, 0 ),(-0.284735 ,-0.4,0 ),( -0.286778, -0.405624 ,0),( -0.334556 ,-0.514181, 0 ),( -0.553402, -0.840365 ,0 ),( -1.2 ,-1.108194 ,0 ),(-1.983612, -0.783612 ,0 ),( -2.308194 ,0 ,0 ),( -1.983612 ,0.783612, 0 ),( -1.2 ,1.108194 ,0 ),( -0.553402, 0.840365, 0 ),( -0.334556 ,0.514181, 0 ),( -0.289495, 0.408848 ,0 ),( -0.284735 ,0.4 ,0 ),( -0.273501, 0.398437, 0)]
            pioint_K = [0,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,28,28]
            degreee = 3
            
        if type == 4:  ##  eye aim sec ctrl
            pointInfo = [(-1, 0, 0 ),( 0 ,0 ,0 ),(0 ,1, 0 ),( 0, 0 ,0 ),( 1, 0, 0 ),( 0, 0, 0),( 0 ,-1, 0) ]
            pioint_K = [0,1,2,3,4,5,6]
            degreee = 1
        if type == 5:  ##  circle 
            pass

            
            
        if type == 6:  ##  
            pass
        
        if type == 7:
            pointInfo = [(-1 ,0 ,0),( 1, 0, 0),( 0, 0 ,0),( 0, 0, 1),( 0, 0 ,-1 ),( 0, 0, 0),( 0 ,1 ,0 ),( 0 ,-1 ,0 ) ]
            pioint_K = [0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 ]
            degreee = 1
            
        if type == 8:
            pointInfo = [ (-1 ,4 ,0),( 1 ,4 ,0),( 1, 1, 0 ),( 4 ,1 ,0),( 4 ,-1, 0),( 1, -1 ,0 ),( 1, -4 ,0),(-1, -4 ,0 ),( -1 ,-1 ,0 ),( -4 ,-1, 0),( -4 ,1, 0 ),( -1, 1, 0),( -1, 4 ,0 ) ]
            pioint_K = [ 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8, 9 , 10 , 11 , 12 ]
            degreee = 1
        
        if type == 9:
            pointInfo = [( 0 ,0 ,0.492662),( -0.0209175, 0 ,0.440895),( -0.0627526, 0, 0.476654 ),( -0.124432 ,0 ,0.464385 ),( -0.183981 ,0 ,0.44417 ),( -0.240383 ,0 ,0.416356 ),( -0.292672 ,0 ,0.381418),( -0.339953, 0, 0.339953 ),( -0.381418, 0 ,0.292672),( -0.416356, 0,0.240383 ),( -0.44417, 0 ,0.183981),( -0.464385 ,0 ,0.124432 ),( -0.476654 ,0 ,0.0627526 ),( -0.423016 ,0, 0 ),( -0.476654 ,0 ,-0.0627526 ),( -0.464385 ,0 ,-0.124432 ),( -0.44417 ,0 ,-0.183981 ),( -0.416356 ,0 ,-0.240383),( -0.381418, 0 ,-0.292672 ),( -0.339953, 0 ,-0.339953 ),( -0.292672, 0 ,-0.381418 ),( -0.240383, 0, -0.416356 ),(-0.183981 ,0 ,-0.44417 ),( -0.124432, 0 ,-0.464385 ),( -0.0627526 ,0 ,-0.476654 ),( 0, 0 ,-0.423016),( 0.0627526, 0 ,-0.476654 ),( 0.124432, 0 ,-0.464385 ),( 0.183981, 0, -0.44417),( 0.240383 ,0 ,-0.416356 ),( 0.292672, 0 ,-0.381418 ),( 0.339953 ,0 ,-0.339953 ),( 0.381418, 0, -0.292672 ),( 0.416356 ,0 ,-0.240383),( 0.44417 ,0, -0.183981 ),( 0.464385 ,0 ,-0.124432 ),( 0.476654, 0, -0.0627526),( 0.423016, 0 ,0 ),( 0.476654, 0 ,0.0627526 ),( 0.464385 ,0 ,0.124432 ),( 0.44417, 0 ,0.183981),( 0.416356, 0 ,0.240383 ),( 0.381418, 0 ,0.292672 ),(0.339953, 0 ,0.339953),( 0.292672 ,0 ,0.381418 ),( 0.240383, 0 ,0.416356 ),( 0.183981 ,0 ,0.44417 ),( 0.124432 ,0 ,0.464385 ),( 0.0627526, 0 ,0.476654 ),( 0.0209175, 0 ,0.440895 ),( 0 ,0 ,0.492662 ),( -0.0290887 ,0 ,0.5 ),( -0.087266, 0 ,0.49491),( -0.17188 ,0 ,0.472238 ),( -0.251272 ,0 ,0.435217 ),( -0.32303, 0 ,0.384972 ),( -0.384972 ,0 ,0.32303 ),( -0.435217 ,0, 0.251272 ),( -0.472238, 0 ,0.17188 ),( -0.49491 ,0 ,0.087266 ),( -0.502545, 0 ,0 ),( -0.49491 ,0 ,-0.087266 ),( -0.472238 ,0, -0.17188),( -0.435217 ,0, -0.251272 ),( -0.384972, 0 ,-0.32303 ),( -0.32303, 0, -0.384972 ),( -0.251272 ,0, -0.435217 ),( -0.17188 ,0, -0.472238 ),( -0.087266 ,0 ,-0.49491 ),( 0 ,0 ,-0.502545 ),( 0.087266 ,0 ,-0.49491),( 0.17188 ,0, -0.472238 ),( 0.251272 ,0, -0.435217),( 0.32303 ,0 ,-0.384972 ),( 0.384972 ,0 ,-0.32303),( 0.435217 ,0, -0.251272 ),( 0.472238 ,0, -0.17188 ),( 0.49491 ,0 ,-0.087266 ),( 0.502545 ,0 ,0),( 0.49491, 0 ,0.087266 ),( 0.472238, 0 ,0.17188 ),( 0.435217 ,0 ,0.251272 ),( 0.384972 ,0 ,0.32303 ),( 0.32303 ,0 ,0.384972 ),( 0.251272 ,0 ,0.435217 ),( 0.17188, 0 ,0.472238 ),( 0.087266 ,0 ,0.49491 ),( 0.0290887, 0 ,0.5 ),( 0 ,0 ,0.492662)]    
            pioint_K = [ 0 , 0 , 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 , 11 , 12 , 13 , 14 , 15 , 16 , 17 , 18 , 19 , 20 , 21 , 22 , 23 , 24 , 25 , 26 , 27 , 28 , 29 , 30 , 31 , 32 , 33 , 34 , 35 , 36 , 37 , 38 , 39 , 40 , 41 , 42 , 43 , 44 , 45 , 46 , 47 , 48 , 49 , 50 , 51 , 52 , 53 , 54 , 55 , 56 , 57 , 58 , 59 , 60 , 61 , 62 , 63 , 64 , 65 , 66 , 67 , 68 , 69 , 70 , 71 , 72 , 73 , 74 , 75 , 76 , 77 , 78 , 79 , 80 , 81 , 82 , 83 , 84 , 85 , 86 , 86 , 86  ]
            degreee =3   
        
        
        if type == 10:    
            pointInfo =[(4, 0, 0 ),( 3 ,0 ,2),( 0 ,0 ,3 ),( -3 ,0 ,2 ),( -4 ,0 ,0 ),( -4, 0, 0 ),( -6 ,0, 0),( -6 ,0 ,0 ),( -5 ,0, 3 ),( -2 ,0 ,5 ),( 0 ,0 ,5 ),( 2 ,0 ,5 ),( 5 ,0 ,3 ),( 6 ,0 ,0 ),( 6 ,0 ,0 ),( 4 ,0, 0)]
        
            pioint_K = [ 0 , 0 , 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 , 11 , 12 , 13 , 13 , 13]
            degreee =3
        if type == 11:    
            pointInfo =[(0 ,0, -5 ),( 2 ,0, -5 ),( 3, 0 ,-4 ),( 3 ,0, -1 ),(2, 0, 0 ),( 2 ,0 ,1 ),( 3 ,0 ,3 ),( 3 ,0 ,5 ),( 2 ,0 ,6 ),( 0 ,0 ,6 ),( -2, 0, 6 ),( -3, 0 ,5 ),( -3 ,0 ,3 ),( -2 ,0 ,1 ),( -2 ,0 ,0 ),( -3 ,0, -1 ),( -3, 0 ,-4 ),( -2 ,0 ,-5 ),( 0, 0, -5)]
        
            pioint_K = [0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 , 11 , 12 , 13 , 14 , 15 , 16 , 17 , 18 ]
            degreee =1
        
        if type == 12:    
            pointInfo =[(-2.0425, 1.067262, -0.267548 ),( -1.90608 ,1.604237, -0.291831 ),(-1.458906 ,2.07659, -0.291831),( -0.838961 ,2.38217 ,-0.291831 ),( 0, 2.472737 ,-0.291831),( 0.838961 ,2.38217 ,-0.291831 ),( 1.458906, 2.07659, -0.291831),( 1.90608 ,1.604237 ,-0.291831 ),( 2.0425 ,1.067262 ,-0.267548 ),( 2.0425, 1.067262, -0.267548 ),( 2.027141 ,1.067262 ,0.828746 ),( 2.36081, 1.067262 ,2.186062 ),( 1.992973, 1.067262 ,4.579428 ),( 0.476366, 1.067262, 4.587467 ),( 0, 0.893449, 4.84523 ),( -0.476366 ,1.067262, 4.587467 ),( -1.992973 ,1.067262 ,4.579428 ),( -2.36081 ,1.067262 ,2.186062 ),( -2.027141 ,1.067262, 0.828746 ),( -2.0425, 1.067262, -0.267548 ),( -2.316573, 1.067262 ,-2.016397 ),( -2.355726 ,1.067262 ,-3.127629 ),( -2.303522, 1.067262 ,-3.323396 ),( -1.664017 ,1.067262 ,-3.745478 ),( -0.907053 ,1.067262 ,-3.778298 ),( 0 ,1.324136 ,-3.778298 ),( 0.907053 ,1.067262 ,-3.778298 ),( 1.664017 ,1.067262, -3.745478 ),( 2.303522, 1.067262, -3.323396 ),( 2.355726 ,1.067262, -3.127629 ),( 2.316573, 1.067262 ,-2.016397 ),( 2.0425, 1.067262 ,-0.267548 ),( 2.027141, 1.067262, 0.828746 ),( 2.36081 ,1.067262 ,2.186062 ),( 1.992973, 1.067262 ,4.579428 ),( 0.476366 ,1.067262 ,4.587467 ),( 0, 0.893449 ,4.84523 ),( 0 ,0.893449 ,4.84523 ),( 0 ,0.893449 ,4.84523 ),( 0 ,1.96364 ,3.699991 ),( 0 ,2.289918 ,2.186062 ),( 0 ,2.316021 ,0.828746 ),( 0 ,2.472737 ,-0.291831 ),( 0 ,2.733656, -2.016397 ),( 0 ,2.77281, -2.708107 ),( 0 ,2.720605 ,-2.903873),( 0, 2.081101, -3.517276 ),( 0, 1.324136, -3.778298)]
        
            pioint_K = [0 , 0 , 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 , 11 , 12 , 13 , 14 , 15 , 16 , 17 , 18 , 19 , 20 , 21 , 22 , 23 , 24 , 25 , 26 , 27 , 28 , 29 , 30 , 31 , 32 , 33 , 34 , 35 , 36 , 37 , 38 , 39 , 40 , 41 , 42 , 43 , 44 , 45 , 45 , 45  ]
            degreee =3        
        
        if type == 13:
            pointInfo = [( 0,0,3 ) , (3, 1.196284, 3 ),(6, 0.503884, 2),( 7, 2.272208, 0 ),( 6 ,0.503884 ,-2 ),( 3 ,1.196284 ,-3 ),( 0 ,0 ,-3)]
            pioint_K = [ 0 , 0 , 0 , 1 , 2 ,3 , 4 ,4 , 4 ]
            degreee =3        
        
        if type == 14:   #DW  facial secondry ctrl
            pass
        
        if type == 15 :
            pointInfo = [(3.52555,1.00778,0.397025),(3.52555 ,1.086722, 0.397025 ),( 2.762662, 1.406693 ,1.248478),(0, 1.505717, 2.688968 ),( -2.762662, 1.406693 ,1.248478 ),( -3.52555, 1.086722 ,0.397025 ),( -3.52555 ,1.00778 ,0.397025)]
            pioint_K = [0 , 0 , 0 , 1 , 2 , 3 , 4 , 4 , 4  ]
            degreee =3 
        
        if type == 16 :
            pointInfo = [(3.52555,-1.00778,0.397025),(3.52555 ,-1.086722, 0.397025 ),( 2.762662, -1.406693 ,1.248478),(0, -1.505717, 2.688968 ),( -2.762662, -1.406693 ,1.248478 ),( -3.52555, -1.086722 ,0.397025 ),( -3.52555 ,-1.00778 ,0.397025)]
            pioint_K = [0 , 0 , 0 , 1 , 2 , 3 , 4 , 4 , 4  ]
            degreee =3 
        
        if type == 17:   #DW  facial secondry ctrl (conner ctrl)
            pass
        if type == 18 :
            pointInfo = [(0.942995-5 ,184.536107-186 ,0.573211 ),( 1.217137-5 ,184.477362-186 ,0.573211),( 2.844064-5 ,184.987263-186, 0.573211 ),( 4.722239-5 ,185.259547-186 ,0.327948 ),( 7.052446-5 ,185.161639-186 ,-0.265478 ),( 8.560227-5 ,184.517305-186 ,-0.808357 ),( 9.304327-5 ,183.734042-186 ,-1.319018 ),( 9.34349-5 ,184.57605-186 ,-1.319018 ),( 8.772836-5 ,185.555128-186 ,-0.808357 ),( 7.134355-5 ,186.553789-186 ,-0.265478 ),( 4.780984-5 ,186.730023-186 ,0.327948 ),( 2.793551-5 ,186.632115-186 ,0.573211 ),( 0.942995-5, 186.220122-186 ,0.573211 ),( 0.942995-5, 184.536107-186 ,0.573211) ]
            pioint_K = [0 ,1 , 2 , 3 , 4 ,5 , 6 , 7 , 8 , 9 , 10 , 11 , 12 , 13 ]
            degreee = 1
        
        if type == 19:   
            pass
        
        if type == 20:   
            pass
            
        if type == 21:   
            pass
            

        
        
        if add == True:
            ctrlAdd = str(curName) + '_temple'
            if type == 5 :
                mc.circle(c=(0,0,0),nr=(0,1,0),sw=360,r=1,d=3,ut = 0,tol= 0.01,s=8,ch=False,n=ctrlAdd)
            elif type == 6 :
            
                mc.circle(c=(0,0,0),nr=(0,1,0),sw=360,r=1,d=1,ut = 0,tol= 0.01,s=4,ch=False,n=ctrlAdd)
            elif type == 14 :
                circle01 = mc.circle(c=(0,0,0),nr=(0,1,0),sw=360,r=1,d=3,ut = 0,tol= 0.01,s=8,ch=False,n='temple_needdelete_circle01')
                circle02 = mc.circle(c=(0,0,0),nr=(1,0,0),sw=360,r=1,d=3,ut = 0,tol= 0.01,s=8,ch=False,n='temple_needdelete_circle02')
                circle03 = mc.circle(c=(0,0,0),nr=(0,0,1),sw=360,r=1,d=3,ut = 0,tol= 0.01,s=8,ch=False,n=ctrlAdd)
                
                for i in [circle01,circle02]:
                    shape = mc.listRelatives(i ,s=True)[0]
                    mc.parent(shape,circle03,add = True ,s=True)
                    mc.delete(i)

            elif type == 17 :
                ctrlAdd = mc.circle(c=(0,0,0),nr=(0,0,1),sw=360,r=1,d=3,ut = 0,tol= 0.01,s=12,ch=False,n='temple_needdelete_circle01')[0]
                mc.scale( 0.5,0.5,0.5,str(ctrlAdd)+'.cv[0]',str(ctrlAdd)+'.cv[2]',str(ctrlAdd)+'.cv[3]',str(ctrlAdd)+'.cv[5]',str(ctrlAdd)+'.cv[6]',str(ctrlAdd)+'.cv[8]',str(ctrlAdd)+'.cv[9]',str(ctrlAdd)+'.cv[11]',r=True,p=(0,0,0) )
            
            elif type == 19:
                ctrlAdd = mc.circle(c=(0,0,0),nr=(0,1,0),sw=360,r=1,d=3,ut = 0,tol= 0.01,s=8,ch=False,n= 'temple_needdelete_circle01' )[0]

                mc.move( 0, 0 ,-0.0560729 , str(ctrlAdd)+'.cv[0]' ,r=True)
                mc.move( 0.144312 ,0 ,-0.262852 , str(ctrlAdd)+'.cv[7]' ,r=True)
                mc.move( 0.540625 ,0 ,-0.875768  , str(ctrlAdd)+'.cv[6]' ,r=True)
                mc.move( 0 ,0 ,-1.792774  , str(ctrlAdd)+'.cv[5]' ,r=True)
                mc.move( 0 ,0 ,-0.0560729 , str(ctrlAdd)+'.cv[2]' ,r=True)
                mc.move( -0.124933 ,0 ,-0.262852 , str(ctrlAdd)+'.cv[3]' ,r=True)
                mc.move( -0.612111 ,0 ,-0.875768, str(ctrlAdd)+'.cv[4]',r=True )            
            elif type ==20:
            
                curve01 = mc.circle(c=(0,0,5),nr=(0,0,1),sw=360,r=1,d=3,ut = 0,tol= 0.01,s=8,ch=False,n='temple_needdelete_circle01')
                curve02 = mc.curve( d = 1 , p = [(0,0,0),(0,0,5)] ,k=[0,1] ,n = ctrlAdd )
                
                shape = mc.listRelatives(curve01 ,s=True)[0]
                mc.parent(shape,curve02,add = True ,s=True)
                mc.delete(curve01)
                
            elif type ==21:
                #mc.curve(d = 1 , p = ( (0.992018,1.567314 ,0),( 0.755999 ,1.766455, 0 ),( 0.453599 ,1.936094 ,0 ),( 0.180702 ,1.995099, 0 ),( 0, 2 ,0 ),( -0.180702 ,1.995099 , 0 ),( -0.453599 ,1.936094, 0 ),( -0.755999 ,1.766455 ,0 ),( -0.992018 ,1.567314 ,0 )) , k =( 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8) )

                curve01 = mc.circle(  nr=(0, 0, 1), c=(2, 0, 0), sw=360, r=1.877 , ch = False , n = 'temple_needdtetele_cirvle01'  )
                curve02 = mc.circle( nr=(0, 0, 1), c=(-2, 0, 0), sw=360, r=1.877, ch = False ,n = 'temple_needdtetele_cirvle02' )
                curve03 = mc.circle( nr=(0, 0, 1), c=(0, 0, 0), sw=65, r=1.877 , ch = False , n = ctrlAdd  )
                self.rotateCurveHull(  curveName = curve03 ,rx = 0,ry = 0, rz = -32.5 , centerP = 0 )
                
                shape1 = mc.listRelatives(curve01 , s=True)[0]
                shape2 = mc.listRelatives(curve02 , s=True)[0]
                mc.parent(shape1,shape2 , curve03 , add = True , s = True )
                
                mc.delete(curve01)
                mc.delete(curve02)


            else:
            
                mc.curve(d = degreee ,p = pointInfo,k= pioint_K ,n=ctrlAdd )    
            Templeshape=mc.listRelatives(ctrlAdd,s=True)
            #print(Templeshape)
            mc.parent(Templeshape,curName,add=True,s=True)
            mc.delete(ctrlAdd)
            for sha in Templeshape:
                CtrlShapeAdd = mc.rename(sha,str(curName)+'Shape')
            
        else:
            if type == 5 :
                mc.circle(c=(0,0,0),nr=(0,1,0),sw=360,r=1,d=3,ut = 0,tol= 0.01,s=8,ch=False,n=curName)
            elif type == 6 :
            
                mc.circle(c=(0,0,0),nr=(0,1,0),sw=360,r=1,d=1,ut = 0,tol= 0.01,s=4,ch=False,n=curName)
            
            elif type == 14 :
                circle01 = mc.circle(c=(0,0,0),nr=(0,1,0),sw=360,r=1,d=3,ut = 0,tol= 0.01,s=8,ch=False,n='temple_needdelete_circle01')
                circle02 = mc.circle(c=(0,0,0),nr=(1,0,0),sw=360,r=1,d=3,ut = 0,tol= 0.01,s=8,ch=False,n='temple_needdelete_circle02')
                circle03 = mc.circle(c=(0,0,0),nr=(0,0,1),sw=360,r=1,d=3,ut = 0,tol= 0.01,s=8,ch=False,n= curName )
                
                for i in [circle01,circle02]:
                    shape = mc.listRelatives(i ,s=True)[0]
                    mc.parent(shape,circle03,s=True)
                    mc.delete(i)
                    
            elif type == 17 :
                ctrlAdd = mc.circle(c=(0,0,0),nr=(0,0,1),sw=360,r=1,d=3,ut = 0,tol= 0.01,s=12,ch=False,n= curName )
                mc.scale( 0.5,0.5,0.5,str(ctrlAdd)+'.cv[0]',str(ctrlAdd)+'.cv[2]',str(ctrlAdd)+'.cv[3]',str(ctrlAdd)+'cv[5]',str(ctrlAdd)+'.cv[6]',str(ctrlAdd)+'.cv[8]',str(ctrlAdd)+'.cv[9]',str(ctrlAdd)+'.cv[11]',r=True,p=(0,0,0) )
            
            elif type == 19:
                mc.circle(c=(0,0,0),nr=(0,1,0),sw=360,r=1,d=3,ut = 0,tol= 0.01,s=8,ch=False,n= curName )

                mc.move( 0, 0 ,-0.0560729 , str(curName)+'.cv[0]' ,r=True)
                mc.move( 0.144312 ,0 ,-0.262852 , str(curName)+'.cv[7]' ,r=True)
                mc.move( 0.540625 ,0 ,-0.875768  , str(curName)+'.cv[6]' ,r=True)
                mc.move( 0 ,0 ,-1.792774  , str(curName)+'.cv[5]' ,r=True)
                mc.move( 0 ,0 ,-0.0560729 , str(curName)+'.cv[2]' ,r=True)
                mc.move( -0.124933 ,0 ,-0.262852 , str(curName)+'.cv[3]' ,r=True)
                mc.move( -0.612111 ,0 ,-0.875768, str(curName)+'.cv[4]',r=True )
            
            elif type ==20:
            
                curve01 = mc.circle(c=(0,0,5),nr=(0,0,1),sw=360,r=1,d=3,ut = 0,tol= 0.01,s=8,ch=False,n='temple_needdelete_circle01')
                curve02 = mc.curve( d = 1 , p = [(0,0,0),(0,0,5)] ,k=[0,1] ,n = curName )
                
                shape = mc.listRelatives(curve01 ,s=True)[0]
                mc.parent(shape,curve02,add = True ,s=True)
                mc.delete(curve01)
                
            elif type ==21:
            
                curve01 = mc.circle(  nr=(0, 0, 1), c=(2, 0, 0), sw=360, r=1.877 , ch = False , n = 'temple_needdtetele_cirvle01'  )
                curve02 = mc.circle( nr=(0, 0, 1), c=(-2, 0, 0), sw=360, r=1.877, ch = False ,n = 'temple_needdtetele_cirvle02' )
                curve03 = mc.circle( nr=(0, 0, 1), c=(0, 0, 0), sw=65, r=1.877 , ch = False , n = curName  )
                self.rotateCurveHull(  curveName = curve03 ,rx = 0,ry = 0, rz = -32.5 , centerP = 0 )
                
                shape1 = mc.listRelatives(curve01 , s=True)[0]
                shape2 = mc.listRelatives(curve02 , s=True)[0]
                mc.parent(shape1,shape2 , curve03 , add = True , s = True )
                
                mc.delete(curve01)
                mc.delete(curve02)
                
            else:
                mc.curve(d = degreee ,p = pointInfo,k= pioint_K ,n = curName )  
                
                
            
    
    def moveCurveHull(self,curveName = '',tx = 0,ty = 0, tz = 0 ):

        curveshapes=mc.listRelatives(curveName,s=True)
        for curveshape  in curveshapes:
            spans=mc.getAttr(str(curveshape)+'.spans')
            degree=mc.getAttr(str(curveshape)+'.degree')
            pointsMounts=spans+degree
        
            mc.move( tx,ty,tz,str(curveshape) + '.cv[0:' + str(pointsMounts)  +']' ,os=True, r=True )
    def setCtrlColor(self,colors,objset):
        shapename=mc.listRelatives(objset,s=True)
        for i in shapename:
            mc.setAttr(str(i)+'.overrideEnabled',1)
            mc.setAttr(str(i)+'.overrideColor',colors)
    
    def rotateCurveHull(self, curveName = '',rx = 0,ry = 0, rz = 0 ,centerP = 1 ):
        curveshapes=mc.listRelatives(curveName,s=True)
        
        cvAllX=[]
        cvAllY=[]
        cvAllZ=[]

        for curveshape in curveshapes:
            spans=mc.getAttr(str(curveshape)+'.spans')
            degree=mc.getAttr(str(curveshape)+'.degree')
            pointsMounts=spans+degree

            for i in range(pointsMounts):

                pointcvPos=mc.xform(str(curveshape)+'.cv['+str(i)+']',q=True,t=True,ws=True)

                cvAllX.append(pointcvPos[0])
                cvAllY.append(pointcvPos[1])
                cvAllZ.append(pointcvPos[2])
                
        pointCVposXMin=cvAllX[0]
        pointCVposYMin=cvAllY[0]
        pointCVposZMin=cvAllZ[0]
        
        pointCVposXMax=cvAllX[0]
        pointCVposYMax=cvAllY[0]
        pointCVposZMax=cvAllZ[0]
        


        for k in range(len(cvAllX)):
            pointCVposXMin=min(pointCVposXMin,cvAllX[k])
            pointCVposXMax=max(pointCVposXMax,cvAllX[k])
            
            pointCVposYMin=min(pointCVposYMin,cvAllY[k])
            pointCVposYMax=max(pointCVposYMax,cvAllY[k])
            
            pointCVposZMin=min(pointCVposZMin,cvAllZ[k])
            pointCVposZMax=max(pointCVposZMax,cvAllZ[k])
        
        centerPivetX=(pointCVposXMin+pointCVposXMax)/2
        centerPivetY=(pointCVposYMin+pointCVposYMax)/2
        centerPivetZ=(pointCVposZMin+pointCVposZMax)/2
        
        if centerP==1:
            centerPivet=[centerPivetX,centerPivetY,centerPivetZ]
            
        else:
            centerPivet = mc.xform(curveName , q=True ,t =True,ws=True)
        mc.rotate( rx,ry,rz,str(curveshape) + '.cv[0:' + str(pointsMounts)  +']' ,os=True, r=True,p = centerPivet )
            
        
    def scaleCurveHull(self,curvename,scalX,scalY,scalZ):
        curveshapes=mc.listRelatives(curvename,s=True)
        
        cvAllX=[]
        cvAllY=[]
        cvAllZ=[]

        for curveshape in curveshapes:
            spans=mc.getAttr(str(curveshape)+'.spans')
            degree=mc.getAttr(str(curveshape)+'.degree')
            pointsMounts=spans+degree

            for i in range(pointsMounts):

                pointcvPos=mc.xform(str(curveshape)+'.cv['+str(i)+']',q=True,t=True,ws=True)

                cvAllX.append(pointcvPos[0])
                cvAllY.append(pointcvPos[1])
                cvAllZ.append(pointcvPos[2])
                
        pointCVposXMin=cvAllX[0]
        pointCVposYMin=cvAllY[0]
        pointCVposZMin=cvAllZ[0]
        
        pointCVposXMax=cvAllX[0]
        pointCVposYMax=cvAllY[0]
        pointCVposZMax=cvAllZ[0]
        


        for k in range(len(cvAllX)):
            pointCVposXMin=min(pointCVposXMin,cvAllX[k])
            pointCVposXMax=max(pointCVposXMax,cvAllX[k])
            
            pointCVposYMin=min(pointCVposYMin,cvAllY[k])
            pointCVposYMax=max(pointCVposYMax,cvAllY[k])
            
            pointCVposZMin=min(pointCVposZMin,cvAllZ[k])
            pointCVposZMax=max(pointCVposZMax,cvAllZ[k])
        
        centerPivetX=(pointCVposXMin+pointCVposXMax)/2
        centerPivetY=(pointCVposYMin+pointCVposYMax)/2
        centerPivetZ=(pointCVposZMin+pointCVposZMax)/2
        
        centerPivet=[centerPivetX,centerPivetY,centerPivetZ]
            
        #mc.select(str(curvename)+'.cv[0:'+str((pointsMounts-1))+']')
        
        for curveshape in curveshapes:
            
            spans=mc.getAttr(str(curveshape)+'.spans')
            degree=mc.getAttr(str(curveshape)+'.degree')
            pointsMounts=spans+degree
            
            
            cv = str(curveshape)+'.cv[0:'+str((pointsMounts-1))+']'
            mc.scale(scalX,scalY,scalZ,cv,r=True,p=centerPivet)
            
    def normalizeHull(self,curvename):
        curveshapes=mc.listRelatives(curvename,s=True)
        
        cvAllX=[]
        cvAllY=[]
        cvAllZ=[]

        for curveshape in curveshapes:
            spans=mc.getAttr(str(curveshape)+'.spans')
            degree=mc.getAttr(str(curveshape)+'.degree')
            pointsMounts=spans+degree

            for i in range(pointsMounts):

                pointcvPos=mc.xform(str(curveshape)+'.cv['+str(i)+']',q=True,t=True,ws=True)

                cvAllX.append(pointcvPos[0])
                cvAllY.append(pointcvPos[1])
                cvAllZ.append(pointcvPos[2])
                
        pointCVposXMin=cvAllX[0]
        pointCVposYMin=cvAllY[0]
        pointCVposZMin=cvAllZ[0]
        
        pointCVposXMax=cvAllX[0]
        pointCVposYMax=cvAllY[0]
        pointCVposZMax=cvAllZ[0]
        


        for k in range(len(cvAllX)):
            pointCVposXMin=min(pointCVposXMin,cvAllX[k])
            pointCVposXMax=max(pointCVposXMax,cvAllX[k])
            
            pointCVposYMin=min(pointCVposYMin,cvAllY[k])
            pointCVposYMax=max(pointCVposYMax,cvAllY[k])
            
            pointCVposZMin=min(pointCVposZMin,cvAllZ[k])
            pointCVposZMax=max(pointCVposZMax,cvAllZ[k])
        
        centerPivetX=(pointCVposXMin+pointCVposXMax)/2
        centerPivetY=(pointCVposYMin+pointCVposYMax)/2
        centerPivetZ=(pointCVposZMin+pointCVposZMax)/2
        
        centerPivet=[centerPivetX,centerPivetY,centerPivetZ]
        

        
        position = mc.xform( curvename ,q=True ,t=True,ws =True)
        for curveshape in curveshapes:
            
            spans=mc.getAttr(str(curveshape)+'.spans')
            degree=mc.getAttr(str(curveshape)+'.degree')
            pointsMounts=spans+degree
            
            
            cv = str(curveshape)+'.cv[0:'+str((pointsMounts-1))+']'
            mc.move( ( position[0] -centerPivet[0] ),( position[1] -centerPivet[1]   ),(  position[2]-centerPivet[2] ), cv , r=True)
    